
package ch.hearc.coursJava.IO.RMI.chat;

import java.net.InetAddress;

import com.bilat.tools.reseau.rmi.RmiTools;

public class RMIData
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/
	public RMIData(String id)
		{
		this(id, RmiTools.getPortDefaultRMI(), RmiTools.getLocalHost());
		}

	public RMIData(String id, int port, InetAddress ip)
		{
		this.id = id;
		this.port = port;
		this.ip = ip;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/
	@Override
	public String toString()
		{
		StringBuilder builder = new StringBuilder();
		builder.append("RMIData [id=");
		builder.append(this.id);
		builder.append(", port=");
		builder.append(this.port);
		builder.append(", ip=");
		builder.append(this.ip);
		builder.append("]");
		return builder.toString();
		}

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/
	public String getId()
		{
		return this.id;
		}

	public int getPort()
		{
		return this.port;
		}

	public InetAddress getIp()
		{
		return this.ip;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/
	private String id;

	private int port;
	private InetAddress ip;
	}
